package com.djl.rs.controller;
import com.djl.rs.mapper.StaffSalaryMapper;
import com.djl.rs.model.StaffSalary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("personSalary")
public class StaffSalaryController {
    @Autowired
    private StaffSalaryMapper staffSalaryMapper;

    @RequestMapping("deleteBySidMon")
    public Integer deleteBySidMon(Integer sid,String month) {
        return  staffSalaryMapper.deleteBySidMonth(sid,month);
    }


    @RequestMapping("updateBySidMon")
    public Integer updateBySidMon(StaffSalary staffSalary) {
        staffSalary.setActualSalary(staffSalary.getBasicSalary()+staffSalary.getBonus()-staffSalary.getDeduct());
        return  staffSalaryMapper.updateBySidMonth(staffSalary);
    }

}
